home *** CD-ROM | disk | FTP | other *** search
Wrap
;------------------------------------------------------------------------ ; ; $VER: ALockUtils-Install 1.0 (31.7.96) ; ; Copyright (c) 1996 Janne Peräaho. ; All Rights Reserved. ; ;------------------------------------------------------------------------ ;------------------------------------------------------------------------ ; Prompt texts ;------------------------------------------------------------------------ (set #etc1-text "Select directory for\npasswd, finger.log, and motd files\nDirectory etc will be created") (set #etc2-text "Copying files to ") (set #etc3-text "Creating directory etc...") (set #host-text "\nSet computer name (HostName)") (set #commands1-text "Select directory for commands") (set #commands2-text "Copying commands to ") (set #commands3-text "Login\nCopy icon?") (set #cmd31-text "No") (set #cmd32-text "Login_1.info") (set #cmd33-text "Login_2.info") (set #commands4-text "Copying icon...") (set #commands5-text "Passwd\nCopy icon?") (set #cmd51-text "No") (set #cmd52-text "Passwd_1.info") (set #cmd53-text "Passwd_2.info") (set #homes1-text "Select directory for users homes\nDirectory homes will be created") (set #homes2-text "Creating directory homes...") (set #home-text "Creating home for root...") (set #doc1-text "Select directory for ALockUtils documentation") (set #doc2-text "Copying documentation...") (set #ustartup1-text "Insert login procedure to the User-Startup?") (set #usneg-text "No") (set #uspos-text "Yes") (set #ustartup2-text "\nInserting login procedure to the User-Startup...") (set #info-text "\nATTENTION!\n\nTo log in as a first time the following user profile is created:\n\nLogin ID: root\nPassword: root\nName: System Administrator\n\nREMEMBER TO CHANGE YOUR PASSWORD!") (set #login-text "\nLog into a system now.") ;------------------------------------------------------------------------ ; Help texts ;------------------------------------------------------------------------ (set #etc1-help "") (set #etc2-help "") (set #etc3-help "") (set #host-help "") (set #commands1-help "") (set #commands2-help "") (set #commands3-help "") (set #commands4-help "") (set #commands5-help "") (set #homes1-help "") (set #homes2-help "") (set #home-help "") (set #doc1-help "") (set #doc2-help "") (set #ustartup1-help "") (set #ustartup2-help "") (set #login-help "") ;------------------------------------------------------------------------ ; Install files ;------------------------------------------------------------------------ ; Check if files installed (set #alock (exists "ETC:passwd" (noreq) ) ) (if (= #alock 0) ( ; Get etc directory (set @default-dest (askdir (prompt #etc1-text) (help #etc1-help) (default "Boot:") ) ) ; Store path (set #etc (tackon @default-dest "etc")) ; Create directory etc (makedir #etc (prompt #etc3-text) (help #etc3-help) (confirm) ) ; Make assign (makeassign "ETC" #etc) ; Copy files (set #copyprompt (cat (cat #etc2-text #etc) "...")) (copyfiles (prompt #copyprompt) (help #etc2-help) (source "ETC/") (dest #etc) (all) (files) (confirm) ) ) ) ;------------------------------------------------------------------------ ; Set HostName ;------------------------------------------------------------------------ ; Check if host name exists (set #hostname (exists "ENVARC:HostName" (noreq) ) ) (if (= #hostname 0) ( ; Get hostname (set #hostname (askstring (prompt #host-text) (help #host-help) (default "AMIGA") ) ) ; Set hostname (textfile (prompt "") (help "") (dest "ENVARC:HostName") (append #hostname) ) (textfile (prompt "") (help "") (dest "ENV:HostName") (append #hostname) ) ) ) ;------------------------------------------------------------------------ ; Install commands ;------------------------------------------------------------------------ ; Get commands directory (set @default-dest (askdir (prompt #commands1-text) (help #commands1-help) (default "C:") ) ) ; Store path (set #commands @default-dest) ; Copy commands (copyfiles (prompt #commands2-text) (help #commands2-help) (source "C/") (dest @default-dest) (all) (files) ) ; Copy Login icons? (set #loginicon (askchoice (prompt #commands3-text) (help #commands3-help) (choices #cmd31-text #cmd32-text #cmd33-text) (default 1) ) ) (select #loginicon ; Don't copy (set #loginicon 0) ; Copy 1st icon ( (copyfiles (prompt #commands4-text) (help #commands4-help) (source "Icons/Login_1.info") (dest #commands) (newname "Login.info") (files) (infos) (noposition) ) ) ; Copy 2nd icon ( (copyfiles (prompt #commands4-text) (help #commands4-help) (source "Icons/Login_2.info") (dest #commands) (newname "Login.info") (files) (infos) (noposition) ) ) ) ; Copy Passwd icons? (set #passwdicon (askchoice (prompt #commands5-text) (help #commands5-help) (choices #cmd51-text #cmd52-text #cmd53-text) (default 1) ) ) (select #passwdicon ; Don't copy (set #passwdicon 0) ; Copy 1st icon ( (copyfiles (prompt #commands4-text) (help #commands4-help) (source "Icons/Passwd_1.info") (dest #commands) (newname "Passwd.info") (files) (infos) (noposition) ) ) ; Copy 2nd icon ( (copyfiles (prompt #commands4-text) (help #commands4-help) (source "Icons/Passwd_2.info") (dest #commands) (newname "Passwd.info") (files) (infos) (noposition) ) ) ) ;------------------------------------------------------------------------ ; Get homes directory ;------------------------------------------------------------------------ (set @default-dest (askdir (prompt #homes1-text) (help #homes1-help) (default "Boot:") (disk) ) ) ; Store path (set #homes @default-dest) ; Store path (set #homes (tackon @default-dest "homes")) ; Create directory homes (makedir #homes (prompt #homes2-text) (help #homes2-help) (confirm) ) ; Make assign (makeassign "HOMES" #homes) ;------------------------------------------------------------------------ ; Perform fake login ;------------------------------------------------------------------------ (textfile (prompt "") (help "") (dest "ENV:UserName") (append "System Administrator") ) (textfile (prompt "") (help "") (dest "ENV:UserID") (append "root") ) ;------------------------------------------------------------------------ ; Create home for root ;------------------------------------------------------------------------ (set #command (cat "C/HomeAdd PATH=" #homes)) (set #command (cat #command " ID=root STARTUP MOTD")) (run #command (prompt #home-text) (help #home-help) ) (makeassign "HOME" "HOMES:root") ;------------------------------------------------------------------------ ; Copy docs ;------------------------------------------------------------------------ (set @default-dest (askdir (prompt #doc1-text) (help #doc1-help) (default "HELP:") ) ) (copyfiles (prompt #doc2-text) (help #doc2-help) (source "Docs/") (dest @default-dest) (all) (files) (confirm) ) ;------------------------------------------------------------------------ ; Update User-Startup ;------------------------------------------------------------------------ (set #toustartup (askchoice (prompt #ustartup1-text) (help #ustartup1-help) (choices #usneg-text #uspos-text) (default 1) ) ) ; Update (if (= #toustartup 1) ( (set #command (cat "ASSIGN ETC: " #etc)) (set #command (cat #command "\nASSIGN HOMES: " #homes)) (set #command (cat #command "\nPATH ")) (set #command (cat #command #commands)) (set #command (cat #command " ADD\nLogin")) (startup "ALockUtils" (prompt #ustartup2-text) (help #ustartup2-help) (command #command) (confirm) ) ) ) ;------------------------------------------------------------------------ ; Information about loging in as a first time ;------------------------------------------------------------------------ (if (= #alock 0) ( (message #info-text (all) ) ) ) (set @default-dest #commands) ;------------------------------------------------------------------------ ; Execute Login command ;------------------------------------------------------------------------ (run "Login" (prompt #login-text) (help #login-help) (confirm) )